package cn.etcweb.bait.baitframe.system.service.impl;

import cn.etcweb.bait.baitframe.system.bean.User;
import cn.etcweb.bait.baitframe.system.mapper.UserMapper;
import cn.etcweb.bait.baitframe.system.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;
    @Override
    public String getUser() {
        List<User> users=userMapper.selectAll();
        return "bait framework"+users.toString();
    }

    @Override
    public void addUser(String name, String pass) {
        User user=new User();
        user.setUserName(name);
        user.setPassword(pass);
        userMapper.insert(user);
    }

}
